#include <cstdio>
#include <string.h>
#include <windows.h>

#define SIZE 101
#define STYLE '#'

void process()
{
    int rate = 0;
    char buffer[SIZE] = { 0 };
    const char* laber = "-\\|/";
    int len = strlen(laber);
    while (rate <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", buffer, rate, laber[rate % len]);
        fflush(stdout);
        buffer[rate] = STYLE;
        rate++;
        Sleep(50);
    }
    printf("\n");
}

int main()
{
    process();
    return 0;
}